Day 2 - Printing

16

Exercises

For today, before you fall asleep bored by my explanations, try these quick exercises.

Exercise 2.01

Print the string “Just a test”

Go to solution

Exercise 2.02

Print a string without the trailing newline (check the manual page)

Go to solution

Exercise 2.03

Run

$ echo "First line\nSecond line"

What happens? Can you find a way to convert that \n into a newline?

Go to solution

As a final remark, to leave you with some food for thought, what happens if you remove the quotes

from the solution of the last exercise? Now go and watch a comedy film, or you will have nightmares.

Suggested film for the evening: Catch Me If You Can (2002) - A film about the dangers of becoming

too skilled with printing.